/*!
 * Ext JS Library 4.0
 * Copyright(c) 2006-2011 Sencha Inc.
 * licensing@sencha.com
 * http://www.sencha.com/license
 */

Ext.define('MyDesktop.WebWin.WebWin', {
    extend: 'Ext.ux.desktop.Module',

    requires: [
        'Ext.form.field.HtmlEditor'
        //'Ext.form.field.TextArea'
    ],

    id: 'webWin',
	url: MyDesktop.Common.GlobalArg.WebSiteUrl,
	title: 'WebWin',

    init : function(){
        this.launcher = {
            text: this.title,
            iconCls:'tinycore-desktop-shortcut-globe'
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow(this.id);
        if(!win){
            win = desktop.createWindow({
                id: this.id,
				width : "100%",
				height : "95%",
                title: this.title,
				iconCls:'tinycore-desktop-shortcut-globe',
                animCollapse:false,
                border: false,
                //defaultFocus: 'notepad-editor', EXTJSIV-1300

                // IE has a bug where it will keep the iframe's background visible when the window
                // is set to visibility:hidden. Hiding the window via position offsets instead gets
                // around this bug.
                hideMode: 'offsets',
                layout: 'fit',
				contentEl : Ext.DomHelper.append(document.body, {
					tag : 'iframe',
					style : "border 0px none;scrollbar:true",
					src : this.url, 
					height : "100%",
					width : "100%"
				})
            });
        }
        return win;
    }
});
